<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html" xmlns:s="http://jboss.com/products/seam/taglib">
<body>
<ui:composition template="/WEB-INF/template.xhtml">

    <ui:define name="body">
        Авторизация → Адрес → <span class="current_header">Подтверждение</span><br/><br/>


        <f:subview id="no_order" rendered="#{currentOrder==null}">
            <p>You have no order.</p>
        </f:subview>

        <f:subview id="orderdetail" rendered="#{currentOrder != null}">
            <h:form id="OrderDetailForm">
                <h:dataTable id="OrderDetailDataTable"
                             value="#{currentOrder.orderLines}" var="line"
                             styleClass="confirmtable"
                             headerClass="confirmtablehead"
                             rowClasses="confirmtableodd,confirmtableeven"
                             columnClasses="confirmtablecol"
                             cellspacing="0">
                    <h:column id="imageColumn">
                        <f:facet name="header" />
                        <h:graphicImage url="#{line.product.imageURL}" rendered="#{line.product.imageURL != null}" alt="#{line.product.title}"
                             styleClass="confirmproductimage" />
                        
                    </h:column>
                    <h:column id="titleColumn" headerClass="confirmtitle">
                        <f:facet name="header">
                            <h:outputText id="TitleText" value="#{messages.cartTitleColumn}"/>
                        </f:facet>
                            <b>#{line.product.title}</b><br />

                        <span class="pricelabel">
                         <h:outputText value="#{line.product.price}">
                            <f:convertNumber type="currency" currencySymbol="руб."/>
                        </h:outputText>
                        </span>
                    </h:column>


                    <h:column id="quantityColumn" headerClass="confirmquantity">
                        <f:facet name="header">
                            <h:outputText id="QuantityText" value="#{messages.cartQuantityColumn}"/>
                        </f:facet>
                        <h:outputText id="QuantityValue" value="#{line.quantity}" style="display: block; width: 100px;"/>
                    </h:column>

                    <h:column id="priceColumn" headerClass="confirmprice">
                        <f:facet name="header">
                            <h:outputText id="PriceText" value="#{messages.cartPriceColumn}"/>
                        </f:facet>
                        <span class="price">
                            <h:outputText value="#{line.quantity*line.product.price}">
                               <f:convertNumber type="currency" currencySymbol="руб."/>
                           </h:outputText>
                        </span>
                    </h:column>

                </h:dataTable>
            </h:form>

            <h:panelGrid id="CostSummary" columns="2">
                <h:outputText value="Доставка:" />
                <h:outputText value="Почта России" />
                <h:outputText value="Оплата:" />
                <h:outputText value="Наложенный платёж" />

                <h:outputText id="CartTotalText" value="#{messages.checkoutTotal}"/>
                <h:outputText id="CartTotalValue" value="#{currentOrder.totalAmount}">
                    <f:convertNumber type="currency" currencySymbol="руб."/>
                </h:outputText>
            </h:panelGrid>



            <br/>
            <h:form id="ConfirmOrCancelForm">
                <h:commandButton id="Cancel" action="back" value="Вернуться" styleClass="backward-button"/>
                &#160;
                <h:commandButton id="Confirm" action="purchase" value="Подтвердить" styleClass="forward-button"/>
            </h:form>


        </f:subview>
    </ui:define>
</ui:composition>
</body>
</html>
